package cn.uexpo.lhz.biz.impl;

import java.util.List;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import cn.uexpo.lhz.common.oldBase.BOException;
import cn.uexpo.lhz.common.oldUtils.PageRequest;
import cn.uexpo.lhz.common.oldUtils.PageResult;
import cn.uexpo.lhz.common.oldUtils.PageUtils;
import cn.uexpo.lhz.biz.EventLocationBiz;
import cn.uexpo.lhz.dao.EventLocationMapper;
import cn.uexpo.lhz.domain.EventLocation;
import cn.uexpo.lhz.domain.EventLocationExample;


@Service
public class EventLocationBizImpl  implements EventLocationBiz {

	@Autowired
	private EventLocationMapper eventLocationMapper;

	@Override
	public int insert(EventLocation record) throws BOException {
		// TODO Auto-generated method stub
		return eventLocationMapper.insert(record);
	}

	@Override
	public int insertSelective(EventLocation record) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteByPrimaryKey(Integer id) throws BOException {
		// TODO Auto-generated method stub
		return eventLocationMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int deleteEntity(EventLocation record) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteByIds(List<Integer> ids) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(List<EventLocation> records) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteByExample(EventLocationExample example) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(EventLocation record) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKeySelective(EventLocation record) throws BOException {
		// TODO Auto-generated method stub
		return eventLocationMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByExampleSelective(EventLocation record, EventLocationExample example) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByExample(EventLocation record, EventLocationExample example) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public EventLocation selectByPrimaryKey(Integer id) throws BOException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public EventLocation selectByUniqueCode(String uniqueCode) throws BOException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<EventLocation> selectByExample(EventLocationExample example) throws BOException {
		// TODO Auto-generated method stub
		return eventLocationMapper.selectByExample(example);
	}

	@Override
	public long countByExample(EventLocationExample example) throws BOException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PageResult findPage(PageRequest pageRequest, EventLocationExample example) throws BOException {
		int pageNum = pageRequest.getPage();
		int pageSize = pageRequest.getLimit();
		PageHelper.startPage(pageNum, pageSize);
		List<EventLocation> records = (List<EventLocation>) eventLocationMapper.selectByExample(example);
		return PageUtils.getPageResult(pageRequest, new PageInfo<EventLocation>(records));
	}




}
